﻿#region

using System;
using System.Linq;
using LinqToTwitter;

#endregion

namespace Linq2Twitter
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            //Authorise
            ITwitterAuthorization authorization = new UsernamePasswordAuthorization(Utilities.GetConsoleHWnd());

            //Initalise
            var context = new TwitterContext(authorization, "https://twitter.com/", "http://search.twitter.com/");
            
            //Signon
            authorization.SignOn();

            //Query
            var peopleImFollowing =
                from friend in context.Friendship
                select friend.Friend;

            //Bang it out
            foreach (var friend in peopleImFollowing.ToList())
            {
                Console.WriteLine("I'm following " + friend.Name);
                Console.WriteLine(friend.Name + "'s status is "+ friend.Status.Text);
                Console.Write(Environment.NewLine);

            }
             
        } 
    }
}